home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
Projects
/
Testers
/
Solar System Tester
< prev
next >
Wrap
Lisp/Scheme
|
1998-10-26
|
2KB
|
73 lines
;;; Solar Theme Example
(def-solar sun
(dates ; rotation speed
(mercurius 0 59 0 0 0)
(venus 0 244.3 0 0 0)
(earth 0 0 23 56 4.1)
(mars 0 0 24 37 22.6)
(jupiter 0 0 9 50 0)
(saturnus 0 0 10 40 0)
(uranus 0 0 12 0 0)
(neptunus 0 0 15 48 0)
(pluto 0 0 6 9 17))
(cycles ; now define year length
(mercurius 0 87.96 0 0 0)
(venus 0 224.68 0 0 0)
(earth 1 0 0 0 0)
(mars 0 686.95 0 0 0)
(jupiter 11.862 0 0 0 0)
(saturnus 29.456 0 0 0 0)
(uranus 84.07 0 0 0 0)
(neptunus 164.81 0 0 0 0)
(pluto 248.53 0 0 0 0))
(location ; and relative location to sun
(mercurius 1 0 0 0 0) ; note that you can express any
(venus 2 0 0 0 0) ; values here using just a one
(earth 3 0 0 0 0) ; parameter and set others as zero
(mars 4 0 0 0 0)
(jupiter 5 0 0 0 0)
(saturnus 6 0 0 0 0)
(uranus 7 0 0 0 0)
(neptunus 8 0 0 0 0)
(pluto 9 0 0 0 0)))
; waves seen on jupiter
(setq waveform
(gen-fourier
(gen-solar sun cycles jupiter
mercurius venus earth mars jupiter saturnus uranus neptunus)
(reverse
(gen-solar sun location jupiter
mercurius venus earth mars jupiter saturnus uranus neptunus))
'(0 0 0 0 0 0 0 0 0)
512))
(def-symbol
piano (vector-to-symbol a h waveform)
)
(def-velocity
piano (vector-round 40 127 waveform)
)
(def-tonality
piano (activate-tonality (pentatonic c 4))
)
(def-length
piano '(1/16)
)
(def-zone
piano (* 512 (get-tick '1/16))
)
(midiport :printer)
(def-tempo 120)
(compile-instrument-p "ccl;output:" "Solar Song"
piano
)